package com.rd.student.jiaji.class2.duyukun.Day0802;

import java.util.Scanner;

public class TestClass {
    public void selectCourses(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("欢迎选课！您可以从以下课表中任选一个作为你本次学习的课程：");
        System.out.println("1.语文 2.数学 3.英语 4.体育");
        System.out.println("请输入课程对应序号：");
        int num =scanner.nextInt();
        Chinese chinese = new Chinese();
        chinese.setName("王五");
        chinese.setAge(39);
        Math math = new Math();
        math.setName("李四");
        math.setAge(35);
        English english = new English();
        english.setName("lice");
        english.setAge(26);
        Sport sport = new Sport();
        sport.setName("张三");
        sport.setAge(23);

            if (num == 1) {
                chinese.teacher();
                System.out.println("教师姓名：" + chinese.getName() + " " + "教师年龄：" + chinese.getAge());

            }
            if (num == 2) {
                math.teacher();
                System.out.println("教师姓名：" + math.getName() + " " + "教师年龄：" + math.getAge());


            }
            if (num == 3) {
                english.teacher();
                System.out.println("教师姓名：" + english.getName() + " " + "教师年龄：" + english.getAge());

            }
            if (num == 4) {
                sport.teacher();
                System.out.println("不好意思，体育老师生病了，你可以选择其他课程。");


            }
        }



    public static void main(String[] args) {
        TestClass testClass = new TestClass();

            testClass.selectCourses();

    }
}
